import { ref } from "vue";
import { defineStore } from "pinia";

export const useUserStore = defineStore(
  "user",
  () => {
    //token
    const token = ref("");
    //设置token
    const setToken = (tk) => {
      token.value = tk;
    };
    //清除token
    const removeToken = () => {
      token.value = "";
    };

    //员工信息

    return {
      token,
      setToken,
      removeToken,
    };
  },
  {
    persist: true,
  }
);
